<?php
require_once("../connection.php");

$gpid = $_POST['gpid'];
$user = $_POST['user'];


//deleting all posts
$res1 = mysql_query("UPDATE site_posts SET `del`='1' WHERE `type`='group_$gpid' AND `user`='$user' AND `postas`!='anonymous'");
if(!$res1) echo mysql_error();


//deleting from the group
$res2 = mysql_query("UPDATE site_group_members SET `del`='1' WHERE `gpid`='$gpid' AND `fbid`='$user'"); 
if(!$res2) echo mysql_error();
?>